package com.smt.ejb3.tutoria.entitybean.enum0;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

@Entity
@Table(name="T_WORKER")
public class Worker implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private int id;
	private Gender gender;
	private String info;
	private Byte[] pic;
	
	@Id
	@Column(name="WORKER_ID")
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Enumerated(EnumType.STRING)
	@Column(name="GENDER", length=6, nullable=false)
	public Gender getGender() {
		return gender;
	}
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	
	@Lob
	public String getInfo() {
		return info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	
	@Lob
	@Basic(fetch=FetchType.LAZY)
	public Byte[] getPic() {
		return pic;
	}
	public void setPic(Byte[] pic) {
		this.pic = pic;
	}
	
}
